package homework.api.day08;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("开始");

        try{
            String line = "null";
            System.out.println(line.length());

            String line2 = "ab741";
            System.out.println(Integer.parseInt(line2));

            System.out.println("try代码运行完成");
        }catch (NullPointerException e){
            System.out.println("空指针异常");
        }catch (Exception e){
            System.out.println("其他异常");
        }

        System.out.println("结束");
    }
}
